<script src="http://protozoa.googlecode.com/svn/trunk/js/functions.js"></script>
<script src="http://protozoa.googlecode.com/svn/trunk/js/dom.js"></script>
<script src="http://protozoa.googlecode.com/svn/trunk/js/dom.event.js"></script>
<script src="http://protozoa.googlecode.com/svn/trunk/js/utils.js"></script>

<!--
<script src="/js/functions.js"></script>
<script src="/js/dom.js"></script>
<script src="/js/dom.event.js"></script>
<script src="/js/utils.js"></script>
<!---->

<style>body {font-size:11px} pre {font:11px mono;border-bottom:1px solid #ddd; padding-bottom:0.3em; margin:0.3em;}</style>

<script src='lex3.js'></script>
<script>


var text = load_file('lex3.js');
var text_array = Array.prototype.slice.apply(text);

var f1 = function() {
	var count = 0;
	for (var i = 0, max = text_array.length; i < max; ++i) {
		if (text_array[i] == '\n')
			++count;
	}
	return count;
};


var f2 = function() {
	var count = 0;
	text.replace(/\n/g, function($0){
		++count;
		return $0;
	});
	return count;
};

var f3 = function() {
	var count = 0;
	return text.match(/\n/g).length;
};


//alert(Array.prototype.slice.apply(x));

alert(f3());

//run_time_test(f3);



</script>




















